const TOKEN_NAME = 'hm-news-token'
const CHANNEL_NAME = 'hm-news-channel'

// 存储频道
export const setStorageChannel = channel => {
  localStorage.setItem(CHANNEL_NAME, JSON.stringify(channel))
}

// 获取频道
export const getStorageChannel = () => {
  return JSON.parse(localStorage.getItem(CHANNEL_NAME))
}

export const setStorageToken = token => {
  localStorage.setItem(TOKEN_NAME, JSON.stringify(token))
}

export const getStorageToken = () => {
  return JSON.parse(localStorage.getItem(TOKEN_NAME))
}

export const removeStorageToken = () => {
  localStorage.removeItem(TOKEN_NAME)
}
